﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.eforceglobal.crux.configuration.DTOs;
using com.eforceglobal.crux.DTOs;

namespace com.eforceglobal.crux.security
{
    
    public interface ICruxSecurityManager
    {
        bool AuthenticateUser(string UserName, string Password, string CompanyName);

        bool AuthenticateUser(string UserName, string Password);

        UserInformation GetUserFromCompany(string UserName, string Password);

        List<RoleInformation> GetRolesForUser(string UserName, string CompanyName);

        bool IsUserInRole(string UserName, string CompanyName, string RoleName);
        
        bool IsUserInRole(string UserName, string CompanyName, List<string> RoleNames);

        // bool DoesUserHavePrivilage(string UserName, string CompanyName, string PrivilageName);

        bool HasAccessToView(string UserName, string CompanyName, string ViewName);

        List<NavigationInformation> GetNavigationItemsForUser(string UserName, string CompanyName);

        List<string> GetAllRoles(int CompanyID);

        bool IsUserSuperAdminOrCompanyAdmin(UserInformation currentuser, int CompanID);

        bool IsUserSuperAdministrator(UserInformation userInformation);

        bool IsUserAuthorizedToEditUser(UserInformation currentUser, UserInformation userBeingModified);

        bool IsUserAdministrator(UserInformation userInformation);

        CompanyInformation GetCompayByUser(string UserName);

        bool IsUserAuthorizedToChangePassword(UserInformation currentUser, UserInformation userBeingModified);

        List<UserInformation> GetUsersByRole(List<string> RoleName);

        string GetApplicationPath();

        bool DoesUserHavePrivilage(UserInformation user, string PrivilageName);

        List<string> GetRolesByPrivilage(string PrivilageName);

    }
}
